<?php
require_once 'core/MConfig.php';
//var_dump($_SERVER);
if (!$_SERVER['DOCUMENT_ROOT']) {
	//print 'am i here?no server?';
	define('ROOT_', '/var/www/');
} else {
	//print 'am i here?has server?';
	define('ROOT_', $_SERVER['DOCUMENT_ROOT']);
}

try{
	MConfig::init(ROOT_.'moreia/XML/config.xml');
}catch (MException $e){
	echo $e->getMessage();
	exit();
}

$old = ini_get('include_path');

$new = 	$old.':'.ROOT_.''.MConfig::$obCfg->path->template_engine_path . ':' .
		ROOT_.''.MConfig::$obCfg->path->core_path . ':' .
		ROOT_.''.MConfig::$obCfg->path->custom_pear_path;
// windows users must use ';' instead of ':' in the line below
ini_set('include_path', $old.':'.$new);


//echo "<br><pre>".print_r(MConfig::$arCfg)."</pre><br>";

//echo "<br>".MConfig::$obCfg->log->attributes()->active."<br>";
?>